<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:p="http://primefaces.org/ui" xmlns:a4j="http://richfaces.org/a4j"
	xmlns:c="http://java.sun.com/jsp/jstl/core">
<h:head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</h:head>
<h:body>
	<ui:composition template="template.xhtml">

		<ui:define name="title">mehmet emmy</ui:define>
		<ui:define name="body">

			<h:form id="formDuyuruList">
				<p:growl id="msgs" showDetail="true" />
							
				<p:dataTable id="duyuruTable" var="duyuru"
					value="#{DuyurularBean.duyuruList}" tableStyle="width:auto"
					paginator="true" rows="10" liveScroll="true" resizableColumns="true"
					rowKey="#{duyuru.duyuruid}" widgetVar="duyurularTable"
					selection="#{DuyurularBean.selectedDuyuru}" selectionMode="single"
					emptyMessage="No software found with given criteria" >
					
					<p:ajax event="rowSelect" update=":formDuyuruList:dyrDlg"
								oncomplete="duyuruListDialog.show()" />
								
					<f:facet name="header">
						<c:if test="#{SirketprofilBean.selectedSirket != null}">
             				<p:commandButton id="iptalButon" value="Firma Seçimini Kaldır"
								action="#{DuyurularBean.restart}" icon="ui-icon-close"
								update=":formDuyuruList" />
						</c:if>
					</f:facet>
							
					<f:facet name="header">
						<p:outputPanel>
							<h:outputText value="Search all fields:" />
							<p:inputText id="globalFilter" onkeyup="duyurularTable.filter()"
								style="width:150px" />
						</p:outputPanel>
					</f:facet>
			
					<p:column headerText="Firma Adı"
						filterBy="#{duyuru.sirketprofil.firmaAd}"
						filterMatchMode="contains" footerText="contains"
						style="width:100px">
						<h:outputText value="#{duyuru.sirketprofil.firmaAd}" />
					</p:column>

					<p:column headerText="Başlık" style="width:100px"
						filterMatchMode="contains" footerText="contains"
						filterBy="#{duyuru.baslik}">
						<h:outputText value="#{duyuru.baslik}" />
					</p:column>

					<p:column headerText="Açıklama" style="width:100px"
						filterMatchMode="contains" footerText="contains"
						filterBy="#{duyuru.aciklama}">
						<h:outputText value="#{duyuru.aciklama}" />
					</p:column>

					<p:column headerText="Tarih" style="width:100px"
						filterMatchMode="contains" footerText="contains"
						filterBy="#{duyuru.tarih}">
						<h:outputText value="#{duyuru.tarih}" style="color:red" />
					</p:column>

					
					<f:facet name="footer">
						<p:commandButton id="refreshButton" value="Refresh"
							icon="ui-icon ui-icon-arrowrefresh-1-w"
							actionListener="#{DuyurularBean.restart}"
							update=":formDuyuruList" />
					</f:facet>
				</p:dataTable>

				<p:dialog header="Duyuru Detay" widgetVar="duyuruListDialog"
					resizable="false" id="dyrDlg" showEffect="fade"
					hideEffect="explode" modal="true">

					<h:panelGrid id="displayDuyuruList" columns="2" cellpadding="4"
						style="margin:0 auto;">

						<h:outputText value="Firma Adı:" />
						<h:outputText
							value="#{DuyurularBean.selectedDuyuru.sirketprofil.firmaAd}"
							style="font-weight:bold" />

						<h:outputText value="Başlık:" />
						<h:outputText value="#{DuyurularBean.selectedDuyuru.baslik}"
							style="font-weight:bold" />


						<h:outputText value="Açıklama:" />
						<h:outputText value="#{DuyurularBean.selectedDuyuru.aciklama}"
							style="font-weight:bold" />

						<h:outputText value="Tarih:" />
						<h:outputText value="#{DuyurularBean.selectedDuyuru.tarih}"
							style="font-weight:bold" />

						<h:outputText value="Önem derecesi:" />
						<h:outputText value="#{DuyurularBean.selectedDuyuru.onemDerecesi}"
							style="font-weight:bold" />

					</h:panelGrid>
				</p:dialog>
			</h:form>
		</ui:define>
	</ui:composition>
</h:body>
</html>